<?php 
use yii\helpers\Html;
use app\models\Article;
use yii\widgets\LinkPager;
use yii\helpers\Url;
 ?>
  <?php $this->beginPage() ?> 
 <!DOCTYPE html>
 <html>
 <head>
 	<title>Live</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <!-- Compiled and minified CSS -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">

  <!-- Compiled and minified JavaScript -->
  <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
 <style type="text/css">
 	
.content {
 position: relative; 
 background: hsla(0,0%,100%,.1);
}
.content::before { 
	content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; filter: blur(20px); margin: -30px;
}

 </style>
 </head>
<?php $this->beginBody() ?> 
 <body style="font-family:Microsoft YaHei;">
 
  	<!--视差  -->
  	 
  	<div class="parallax-container" id="pc1" style="height: 100px">
  	   <nav class="content">
	    
	      <div class="nav-wrapper">
	  	<div class="container">
	      <ul class="left hide-on-med-and-down">

	        <li ><a href="<?= Url::to(['blog/article']) ?>">技术</a></li>
	        <li class="active"><a href="<?= Url::to(['blog/live']) ?>">生活</a></li>
	        <li ><a href="#">网站更新进度</a></li>

	      </ul>
	      <ul class="right hide-on-med-and-down">

	     
	        <li ><a href="<?=Url::to(['admin/login'])?>">登录</a></li>
	       
	      </ul>
	  </div>
	    </div>
	  </nav>	
	    <div class="parallax"><img src="/images/youname.png" id=background></div>
	    <div style="margin-left: 10%;color: white;font-size: 40px" id="title"><div><?php echo $blogname ?></div><div style="font-size: 17px">&nbsp;<?php echo $intro ?></div></div>
	  </div>
<!-- <img src="/demo/frontend/web/images/youname.png"> -->
	  <div class="section" style="padding: 0px">

	    <div class="row container" >
	      
	      <div class="col s8" style="">
	      	 <div style="font-size: 40px;margin-top: 20px;margin-bottom: 20px;color: #0f88eb"> 日记</div>	
	      	 <div style="font-size: 18px;margin-bottom: 20px;color: #8590a6">这是一片属于我的净土...</div>	       	 	      	 
	      	 <?php 	 	      	   
	      	 foreach($lives as $key=>$val)
		      {		
		        $option1 =['href' => Url::to(['blog/live','id'=>$val->id]),'style'=>['font-size'=>'25px','color'=>'black']];
		        $option2 =['style'=>'','class'=>'truncate'];
		      $changeToTimestamp= strtotime($val->create_date); 
		      /*
		       将datetime格式转化为时间戳，再由时间戳转化为格式为y-m-d的datetime
		       display:block;height:100px;overflow:hidden
		      */
		      // $str=preg_replace("/<(\/?img.*?)>/si","",$val->article_content); //过滤form标签
		      $live_time = date('Y-m-d',$changeToTimestamp);
		         echo  Html::tag('div',  "发布时间:".$live_time,['style'=>['color'=>'#767676']]);
		         echo "<div style=\"margin-bottom:30px\">";
		         echo Html::tag('a', $val->live_title,$option1);
		        echo "</div>";	          
		      }
		      ?>		
	      	  <?= LinkPager::widget(['pagination' => $pages]); 
	      	  ?>	
	      	 
	      </div>
	      <div class="col s4" style="background-color:white">
	      	<!-- search form -->
	      	<div class="input-field">
	              <!-- <i class="material-icons prefix"></i> -->
	              <input id="icon_prefix" type="text" class="validate">
	              <label for="icon_prefix">search</label>
	             </div>

	             <!--  -->
	             <table>
		        <thead>
		          <tr>
		              <th data-field="id">近期文章</th>		              
		          </tr>
		        </thead>
		        <tbody>
		            <?php 
		             foreach($newlive as $key=>$val){
		             	$option1 =['href' =>Url::to(['blog/live','id'=>$val->id]),'style'=>'font-size:15px'];
		             	echo "<tr>";
		             	 echo "<td>";		             	
		             	 echo Html::tag('a', $val->live_title,$option1);
		             	 echo "</td>";
		             	 echo "</tr>";
		             }		         
		             ?>			            		          
		        </tbody>
		  </table>
	             <!--  -->
	      </div> 
	  </div>
	</div>
	<div class="parallax-container" id="pc2">
		<!-- container -->
	    <div class="container" style=";margin-top:100px" id="footer">
	            <div class="row" style="margin-bottom: 0px;">
	              <div class="col l6 s12">
	                <h5 class="white-text" style="">ZhanXiong's 博客</h5>
	                <div class="grey-text text-lighten-4" style="">后台基于yii2框架|前端基于Materialize框架</div>
	                <div class="grey-text text-lighten-4" style="">博主QQ:2674981316 欢迎各位大牛指导，谢谢！</div>
	                <div class="grey-text text-lighten-4" style="">   ZhanXiong版权所有 | 托管于阿里云主机 | 粤ICP备17139355号-1</div>
	              </div>
	              <div class="col l4 offset-l2 s12">
	                <h5 class="white-text" >链接</h5>
	                <ul>
	                  <li><a class="grey-text text-lighten-3" href="http://www.yiichina.com/">Yii2</a></li>
	                  <li><a class="grey-text text-lighten-3" href="http://materializecss.com">Materialize</a></li>
	        <!--           <li><a class="grey-text text-lighten-3" href="#!">Link 3</a></li>
	                  <li><a class="grey-text text-lighten-3" href="#!">Link 4</a></li> -->
	                </ul>
	              </div>
	            </div>
	            
	         </div>
	         <!-- container -->	
	    <div class="parallax"><img src="/images/youname.png" id=background></div>
	  </div>
	  <!-- footer -->
	<!-- <footer class="page-footer" style="background-color: #55abed">
          <div class="container" style="background: hsla(0,0%,100%,.3">
            <div class="row" style="margin-bottom: 0px">
              <div class="col l6 s12">
                <h5 class="white-text">ZhanXiong's 博客</h5>
                <div class="grey-text text-lighten-4">后台基于yii2框架|前端基于Materialize框架</div>
                <div class="grey-text text-lighten-4">博主QQ:2674981316 欢迎各位大牛指导，谢谢！</div>
              </div>
              <div class="col l4 offset-l2 s12">
                <h5 class="white-text">链接</h5>
                <ul>
                  <li><a class="grey-text text-lighten-3" href="http://www.yiichina.com/">Yii2</a></li>
                  <li><a class="grey-text text-lighten-3" href="http://materializecss.com">Materialize</a></li>
                  <li><a class="grey-text text-lighten-3" href="#!">Link 3</a></li>
                  <li><a class="grey-text text-lighten-3" href="#!">Link 4</a></li> 
                </ul>
              </div>
            </div>
          </div>
           <div class="footer-copyright">
            <div class="container">
            ZhanXiong版权所有 | 托管于阿里云主机| 粤ICP备17139355号-1
            </div>
          </div> 
        </footer> -->
 <script type="text/javascript">
      $(document).ready(function(){
      $('.parallax').parallax();
    });  



        
 </script>
 <script type="text/javascript">
 var h=$(window).height();
 var pc1= document.getElementById("pc1"); 
 var pc2= document.getElementById("pc2"); 
 var title = document.getElementById("title"); 
 var footer = document.getElementById("footer");

pc1.style.height=h*0.35+"px";
pc2.style.height=h*0.35+"px";
title.style.marginTop = h*0.35-h*0.35*0.6+"px";
footer.style.marginTop = h*0.35-h*0.35*0.4+"px";
 </script>
  <?php $this->endBody() ?>
 </body>
 </html>
  <?php $this->endPage() ?>